<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var o = {
            age: 18
        }
        if (o['age']) {
            console.log('里面有该属性')
        } else {
            console.log('没有该属性')
        }
        var str = 'abcddsrefsdfsereg'
        var e = []
        for (var i = 0; i < str.length; i++) {
            var chars = str.charAt(i);
            if (e[chars]) {
                e[chars]++;

            } else {
                e[chars] = 1
            }
        }
        console.log(e);
    </script>
</head>

<body>

</body>

</html>